package com.example.service.commodity.Impl;

import com.example.mapper.commodity.ProductMapper;
import com.example.pojo.commodity.Product;
import com.example.pojo.commodity.ProductType;
import com.example.service.commodity.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author LinJie
 * @create 2020-12-11 10:06
 */
@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<Product> queryAll() {
        return productMapper.queryAll();
    }

    @Override
    public Product queryByName(String name) {
        return productMapper.queryByName(name);
    }

    @Override
    public List<Product> queryByClass(String prdClass) {
        return productMapper.queryByClass(prdClass);
    }

    @Override
    public Product queryByID(String id) {
        return productMapper.queryByID(id);
    }

    @Override
    public List<Product> queryBySomething(String proId, String proName, String proClass) {
        return productMapper.queryBySomething(proId, proName, proClass);
    }

    @Override
    public int updateOne(String proId, int product_sold, int product_online, double product_profit) {
        return productMapper.updateOne(proId, product_sold, product_online, product_profit);
    }

    @Override
    public int updateScrap(String proId, int product_scrap, int product_stock, double product_profit) {
        return productMapper.updateScrap(proId, product_scrap, product_stock, product_profit);
    }

    @Override
    public int addOne(Product product) {
        return productMapper.addOne(product);
    }

    @Override
    public int updateWhole(Product product) {
        return productMapper.updateWhole(product);
    }

    @Override
    public List<Product> orderByProfitUp() {
        return productMapper.orderByProfitUp();
    }

    @Override
    public List<Product> orderByProfitDown() {
        return productMapper.orderByProfitDown();
    }

    @Override
    public List<Product> orderByScrapUp() {
        return productMapper.orderByScrapUp();
    }

    @Override
    public List<Product> orderByScrapDown() {
        return productMapper.orderByScrapDown();
    }

    @Override
    public List<Product> orderBySoldUp() {
        return productMapper.orderBySoldUp();
    }

    @Override
    public List<Product> orderBySoldDown() {
        return productMapper.orderBySoldDown();
    }

    @Override
    public List<ProductType> queryAllClass() {
        return productMapper.queryAllClass();
    }

}